﻿<common:UserControlBase  x:Class="Sesa.Desktop.Views.MaterialListView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:common="clr-namespace:Sesa.Desktop.Common"
             xmlns:controls="clr-namespace:MahApps.Metro.Controls;assembly=MahApps.Metro"
             mc:Ignorable="d"
             d:DesignHeight="300" d:DesignWidth="300" xmlns:my="http://schemas.microsoft.com/wpf/2008/toolkit"
             DataContext="{Binding Source={StaticResource Locator}, Path=MaterialListViewModel}">
  <Grid>
    <my:DataGrid Name="dataGrid" ItemsSource="{Binding Entities}" AutoGenerateColumns="False" AlternatingRowBackground="{x:Null}"
                 CanUserAddRows="False" CanUserDeleteRows="False"
                 CanUserReorderColumns="True" IsReadOnly="True"
                 RowHeaderWidth="20" SelectedItem="{Binding SelectedEntity}">
      <my:DataGrid.Columns>
        <my:DataGridTextColumn Header="عنوان" Binding="{Binding Caption}"/>
        <my:DataGridTextColumn Header="واحد" Binding="{Binding Unit.Caption}"/>
        <my:DataGridTextColumn Header="نمایش اعشاری" Binding="{Binding IsFloatValue,Converter={StaticResource ResourceConverter}}"/>
        <my:DataGridTextColumn Header="جزو اقلام بسته بندی" Binding="{Binding IsPackingType,Converter={StaticResource ResourceConverter}}"/>
      </my:DataGrid.Columns>
    </my:DataGrid>
  </Grid>
</common:UserControlBase >
